-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[master-2.x] Force sync state root from all peers #1854
[master-2.x] Force sync state root from all peers #1854
Conversation
@erikzhang @shargon Can you review this? |
@@ -281,15 +286,11 @@ private void RequestTasks(TaskSession session) | |||
var height = Blockchain.Singleton.Height; | |||
if (state_height + 1 < height) | |||
{ | |||
var state = Blockchain.Singleton.GetStateRoot((uint)(state_height + 1)); | |||
if (state is null || state.Flag == StateRootVerifyFlag.Unverified) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After every block persisted, local state root will be calculated and persist into StateRoots
with Unverified
flag. Only check the block height is enough.
Line 656 in 95596f9
PersistLocalStateRoot(); |
I've already applied it on testnet seeds and all works well for more than a week. Root never stops sync again. |
Fix root sync slowly in
mast-2.x
, especially many peers are2.10.3
.